Apache rewrite: dir/file.php?foo=bar&name=val -> file.php?newparam=dir&foo=bar&name=val?

Try the following, let me know if it works: RewriteEngine on RewriteBase / # Allow files that exist to bypass rewrites RewriteCond %{REQUEST_FILENAME}! -f RewriteCond %{REQUEST_FILENAME}! -d # Rewrite remaining files RewriteRule ^/(-a-zA-Z0-9_+)/(-a-zA-Z0-9_+\.

Php)$ /$2? Newparam=$1 L,QSA This only allows dir and file. Php containing alphanumeric characters, underscore and dash The final rule looks for a URI matching two path components, between the forward slashes.

The first must be 1 or more characters in the given set -a-zA-Z0-9_ the second must be the same, but ending in php The and $ characters match the front and back of the URI. The replacement says put the second bracketed group (the file. Php part) at the front, and put the first bracketed group (the dir part) as a parameter called newparam The L,QSA at the end says that this is the Last L rule if it matches, so stop matching further and perform the redirect and the QSA means "Query String Append", which adds the original query string to the end again, leaving that off would remove the original query string.

Try the following, let me know if it works: RewriteEngine on RewriteBase / # Allow files that exist to bypass rewrites RewriteCond %{REQUEST_FILENAME}! -f RewriteCond %{REQUEST_FILENAME}! -d # Rewrite remaining files RewriteRule ^/(-a-zA-Z0-9_+)/(-a-zA-Z0-9_+\.

Php)$ /$2? Newparam=$1 L,QSA This only allows dir and file. Php containing alphanumeric characters, underscore and dash.

The final rule looks for a URI matching two path components, between the forward slashes. The first must be 1 or more characters in the given set -a-zA-Z0-9_+, the second must be the same, but ending in .php. The ^ and $ characters match the front and back of the URI.

The replacement says put the second bracketed group (the file. Php part) at the front, and put the first bracketed group (the dir part) as a parameter called newparam. The L,QSA at the end says that this is the Last L rule if it matches, so stop matching further and perform the redirect and the QSA means "Query String Append", which adds the original query string to the end again, leaving that off would remove the original query string.

Hmm, nice. I can never figure out how QSA works but this looks promising. – Stephan Muller Dec 9 '10 at 14:02 1 QSA adds the current query string to the rewritten URL.

Without QSA, the original query string would be lost. – Lekensteyn Dec 9 '10 at 14:05 @Lekensteyn Thanks, should have explained really, I'll put an explanatory note. – Orbling Dec 9 '10 at 14:07.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions